package com.dongzili.demo.customer.pgsql.model;


import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.Settings;
import org.dromara.easyes.annotation.rely.FieldType;
import org.dromara.easyes.annotation.rely.RefreshPolicy;

import java.time.LocalDateTime;

/**
* 资源_目录 关联表
* &#064;TableName s_relation
*/
@DS("pgsql")
@Data
@TableName(value ="s_relation")
@IndexName(value = "s_relation_index", refreshPolicy = RefreshPolicy.IMMEDIATE)
@Settings(shardsNum = 3, replicasNum = 1)
public class RelationPG {

    @IndexId(type = org.dromara.easyes.annotation.rely.IdType.CUSTOMIZE)
    @TableId(value="\"ID\"", type = IdType.AUTO)
    private Integer id;

    /**
    * 资源code
    */
    @IndexField(fieldType = FieldType.KEYWORD, fieldData = true)
    @TableField("\"ResCode\"")
    private String resCode;

    /**
    * 章节id
    */
    @TableField("\"TbCatalogID\"")
    private Integer tbCatalogID;

    /**
    * 章节路径
    */
    @TableField("\"TbCatalogPath\"")
    private String tbCatalogPath;

    /**
    * （暂无用）
    */
    @TableField("\"TbCatalogPaths\"")
    private String tbCatalogPaths;

    /**
    * 版本ID
    */
    @TableField("\"VersionID\"")
    private Integer versionID;

    /**
    * 版本名称
    */
    @TableField("\"VersionName\"")
    private String versionName;

    /**
    * 类别id
    */
    @TableField("\"LibraryID\"")
    private Integer libraryID;

    /**
    * 类别名称
    */
    @TableField("\"LibraryName\"")
    private String libraryName;

    /**
    * 类型id
    */
    @TableField("\"ResTypeID\"")
    private Integer resTypeID;

    /**
    * 类型名称
    */
    @TableField("\"ResTypeName\"")
    private String resTypeName;

    /**
    * 类型父id
    */
    @TableField("\"ResTypePID\"")
    private Integer resTypePID;

    /**
    * 学段id
    */
    @TableField("\"TermID\"")
    private Integer termID;

    /**
    * 学段名称
    */
    @TableField("\"TermName\"")
    private String termName;

    /**
    * 学科id
    */
    @TableField("\"SubjectID\"")
    private Integer subjectID;

    /**
    * 学科名称
    */
    @TableField("\"SubjectName\"")
    private String subjectName;

    /**
    * 格式
    */
    @TableField("\"Format\"")
    private String format;

    /**
    * 格式名称
    */
    @TableField("\"FormatName\"")
    private String formatName;

    /**
    * 下载次数
    */
    @TableField("\"DLoadTimes\"")
    private Integer dLoadTimes;

    /**
    * 分享次数
    */
    @TableField("\"ShareTimes\"")
    private Integer shareTimes;

    /**
    * 点击次数
    */
    @TableField("\"ClickTimes\"")
    private Integer clickTimes;

    @TableField("\"SCTimes\"")
    private Integer sCTimes;

    /**
    * 创建时间
    */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty("createTime")
    @TableField("\"CreateTime\"")
    @IndexField( fieldType = FieldType.DATE, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
    * 是否有效
    */
    @TableField("\"IsValid\"")
    private Boolean isValid;

    /**
    * 0上架，1下架
    */
    @TableField("\"Flag\"")
    private Boolean flag;

    /**
    * 类型父名称
    */
    @TableField("\"ResTypePName\"")
    private String resTypePName;

    /**
    * 章节code
    */
    @TableField("\"TbCatalogCode\"")
    private String tbCatalogCode;

    /**
    * 资源年限
    */
    @TableField("\"ResYear\"")
    private String resYear;

    /**
    * 排序
    */
    @TableField("\"ShowOrder\"")
    private Integer showOrder;

    /**
    * 是否是精品资源
    */
    @TableField("\"IsGoodRes\"")
    private Integer isGoodRes;

    /**
    * 资源名称
    */
    @IndexField(fieldType = FieldType.KEYWORD, fieldData = true)
    @TableField(value = "\"ResName\"",condition = SqlCondition.LIKE)
    private String resName;

    /**
    * 资源分类（0资源库，1校本资源，2excel导入，3特殊教育）
    */
    @TableField("\"ResType\"")
    private Integer resType;

    /**
    * 机构id
    */
    @TableField("\"OrgID\"")
    private Integer orgID;

    /**
    * 是否是校本资源
    */
    @TableField("\"IsXBRes\"")
    private Integer isXBRes;

    /**
    * 更新时间
    */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty("modifyTime")
    @TableField("\"modify_time\"")
    @IndexField( fieldType = FieldType.DATE, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime modifyTime;


}
